import { Base} from 'base.js';


class UserModel extends Base {
  constructor(options) {
    super(options)
    this.$$path = {
      getConfig: '/System/getConfig',
      userAuth: '/OpenApi/userAuthApplet',
      getSwiperList: '/System/getSwiperList',
      bindStudentMsg: '/UserApi/bindStudentMsg',
      storeList: '/Store/storeList',
      getImageList: '/User/getImgsList',
      delPic: '/User/delUploadImg',
      addrList:'/User/addrList',
      mobilePhone:'/User/mobilePhone',
      addAdd:'/User/addAdd',
      editAdd:'/User/editAdd',
      deleteAddr:'/User/addDel',
      getDefaultAdd:'/User/getDefaultAdd',
      apply:'/Store/apply',
      userInfo:'/User/getUserInfo',
      systemRecharge:'/Recharge/systemRecharge',
      account:'/Recharge/account',
      goRecharge:'/Recharge/add',
      selectStore:"/User/selectStore",
      getUserByCode: "/OpenApi/getUserByCode",
      getStoreApply: "/User/getStoreApply",
    }
  }
  getStoreApply(params){
    return this.postRequest(this.$$path.getStoreApply, params)
  }
  selectStore(params) {
    return this.postRequest(this.$$path.selectStore, params)
  }
  goRecharge(params){
    return this.postRequest(this.$$path.goRecharge, params)
  }
  account(params){
    return this.postRequest(this.$$path.account, params)
  }
  systemRecharge(params){
    return this.postRequest(this.$$path.systemRecharge, params)
  }
  getConfig(params) {
    return this.postRequest(this.$$path.getConfig, params)
  }

  /**
   * 获取用户信息
   */
  userAuth(params) {
    return this.postRequest(this.$$path.userAuth, params)
  }

  /**
   * 门店列表
   * @param {*} params 
   */
  storeList(params) {
    return this.postRequest(this.$$path.storeList, params)
  }

  getSwiperList(params) {
    return this.postRequest(this.$$path.getSwiperList, params)
  }
 
  getStudentMsg(params) {
    return this.getRequest(this.$$path.bindStudentMsg, params)
  }

  /**
   * 绑定用户信息
   * @param {*} params 
   */
  getSumbitFormData(params) {
    return this.getRequest(this.$$path.getSumbitFormData, params)
  }

  /**
   * 获取图片列表
   * @param {*} params 
   */
  getImageList(params) {
    return this.postRequest(this.$$path.getImageList, params)
  }

  /**
   * 删除图片
   * @param {*} params 
   */
  delPic(params) {
    return this.postRequest(this.$$path.delPic, params)
  }

  /**
   * 地址列表
   * @param {*} params 
   */
  addrList(params) {
    return this.postRequest(this.$$path.addrList, params)
  }

  /**
   * 解析手机号码
   * @param {*} params 
   */
  mobilePhone(params) {
    return this.postRequest(this.$$path.mobilePhone, params)
  }

  /**
   * 添加地址
   */
  addAdd(params) {
    return this.postRequest(this.$$path.addAdd, params)
  }
  
  /**
   * 编辑地址
   */
  editAdd(params) {
    return this.postRequest(this.$$path.editAdd, params)
  }

  /**
   * 删除地址
   * @param {*} params 
   */
  deleteAddr(params) {
    return this.postRequest(this.$$path.deleteAddr, params)
  }
  
  /**
   * 获取默认地址
   * @param {*} params 
   */
  getDefaultAdd(params) {
    return this.postRequest(this.$$path.getDefaultAdd, params)
  }

  /**
   * 申请加盟
   */
  apply(params) {
    return this.postRequest(this.$$path.apply, params)
  }

  /**
   * 用户详情
   */
  userInfo(params) {
    return this.postRequest(this.$$path.userInfo, params)
  }

   /**
   * 获取openid
   * @param {*} params 
   */
  getUserByCode(params) {
    return this.postRequest(this.$$path.getUserByCode, params)
  }
}

export {
  UserModel
};